#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
int
main(int argc, char *argv[]){
    
    
    int result = access("t_access.txt",F_OK);
    if(result != -1){
        
        printf("文件存在\n");    

        if(access("t_access.txt",R_OK) != -1){
                
            printf("文件有读全选\n");
        }

        if(access("t_access.txt",W_OK)!= -1){
            
            printf("文件有写权限\n");
        }
        if(access("t_access.txt",X_OK) != -1){
            
            printf("文件有执行权限\n");
        }

    }else{
        
        printf("文件不存在\n");

    }

    return 0;
}
